# Maintainer: Ray Donnelly <mingw.android@gmail.com>

_realname=pdftex
pkgbase=mingw-w64-${_realname}-svn
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0
pkgrel=1
url="https://foundry.supelec.fr/projects/pdftex"
arch=('any')
makedepends=('svn')
source=(xetex-code::git+https://git.code.sf.net/p/xetex/code)
sha256sums=('SKIP')
_svntrunk=https://foundry.supelec.fr/svn/pdftex/branches/stable

build() {
  cd "${srcdir}"
  msg "Connecting to $_svntrunk SVN server...."
  if [[ -d ${_realname}/.svn ]]; then
    (cd ${_realname} && svn up --username anonsvn --password anonsvn)
  else
    svn co --username anonsvn --password anonsvn $_svntrunk --config-dir ./ ${_realname}
  fi
  [[ -d ${_realname}/source/src/texk/texlive ]] && rm -rf ${_realname}/source/src/texk/texlive
  cp -rf xetex-code/source/texk/texlive ${_realname}/source/src/texk/
  cd ${_realname}/source
  ./build-pdftex.sh
}

package() {
  msg "lol"
}
